package com.java.system.common.dao;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;

import java.util.List;

/**
 * @ClassName: MyMapper
 * @Description:
 * @Version: v1.0.0
 * @Author: tengyun
 * @Date: 2019-06-14 11:41
 * Modification History:
 * Date             Author      Version     Description
 * -------------------------------------------------------------
 * 2019-06-14      tengyun      v1.0.0      创建
 */
public interface MyMapper<T> {

    /**
     * @Description  批量全字段插入
     * @Date  2019/6/6
     * @Param [record]
     * @return int
     **/
    @InsertProvider(type = MyProvider.class, method = "dynamicSQL")
    int batchInsert(List<T> recordList);

    /**
     * @Description  批量全字段插入或更新
     * @Date  2019/6/6
     * @Param [record]
     * @return int
     **/
    @InsertProvider(type = MyProvider.class, method = "dynamicSQL")
    int batchInsertOrUpdate(List<T> recordList);

    /**
     * @Description  全字段插入或更新
     * @Date  2019/6/6
     * @Param [record]
     * @return int
     **/
    @InsertProvider(type = MyProvider.class, method = "dynamicSQL")
    int addOrEdit(T record);
    /**
     * @Description  非空字段插入或更新
     * @Date  2019/6/6
     * @Param [record]
     * @return int
     **/
    @InsertProvider(type = MyProvider.class, method = "dynamicSQL")
    int addOrEditSelective(T record);

    /**
     * 批量删除
     * @param recordList
     * @return
     */
    @DeleteProvider(type = MyProvider.class,method = "dynamicSQL")
    int batchDelete(List<T> recordList);
}
